module.exports = app => {
  class LoginLogService extends app.Service {
    async add (data){
        return new Promise(async (resolve, reject) => {
            let curDate = new Date()
            this.ctx.model.LoginLog({
                loginDate: curDate.getTime(),
                loginLocalDate: curDate.toLocaleString(),
                ...data
            }).save((err, res) => {
                if (err) {
                    console.log(err);
                    reject(err);
                    return
                }
                resolve(res)
            });
        })
    
    }
  }
  return LoginLogService
}
